import javaservicesmanager.JavaServicesManager;
import utils.DataManageUtils;

import javax.swing.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * @version V1.0
 * @Title:
 * @Package
 * @Description:
 * @author: runoob
 * @date:
 */
public class Main {

    public static void main(String[] args) throws ClassNotFoundException, UnsupportedLookAndFeelException, InstantiationException, IllegalAccessException, SQLException, IOException {
//设置窗口为windows风格
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
//        UIManager.put("ComboBox.background", new Color(0, 0, 0, 0));
        UIManager.put("TabbedPane.contentOpaque", false);
        Connection connectionNet = DataManageUtils.getConnection();
        Statement statementNet = connectionNet.createStatement();
//        DataManageUtils.recreateTable(statementNet);
        DataManageUtils.createTable(statementNet);
        statementNet.close();
        connectionNet.close();
        new JavaServicesManager();
    }

    public void temp() throws IOException, InterruptedException {
        Process process = Runtime.getRuntime().exec("java -jar D:\\workspace\\idea\\PGMiniProgramExtendAPI\\target\\PGMiniProgramExtendAPI.jar");
        InputStream fis = process.getInputStream();
        InputStreamReader isr = new InputStreamReader(fis,"GB2312");
        BufferedReader br = new BufferedReader(isr);
        String line;
        System.out.println("==========================================================================");
        while ((line = br.readLine()) != null) {
            System.out.println(line);
        }
        System.out.println("==========================================================================");
        Thread.sleep(30000);
        process.destroy();
    }

}
